#if !defined(AFX_EXCESSSTATISTICSDLG_H__AF1CE6CD_F31E_4963_A41A_D0FDD976455D__INCLUDED_)
#define AFX_EXCESSSTATISTICSDLG_H__AF1CE6CD_F31E_4963_A41A_D0FDD976455D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ExcessStatisticsDlg.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CExcessStatisticsDlg dialog

#include "GUIBaseLib\TopDialog.h"

struct ExcessStatisticsItem;
struct RecordAckStruct;
struct RecordItem;

class CExcessStatisticsDlg : public CTopDialog
{
// Construction
public:
	CExcessStatisticsDlg(CWnd* pParent = NULL);   // standard constructor
  void InitDialogForAnalog();
  void InitDialogForDigital();
  void InsertStatisticsToListCtrl(const std::vector<ExcessStatisticsItem *>& StatisticsResult);
  void InsertAnalogStatisticsToListCtrl(const std::vector<ExcessStatisticsItem *>& StatisticsResult);
  void InsertDigitalStatisticsToListCtrl(const std::vector<ExcessStatisticsItem *>& StatisticsResult);
  void TakeStatistics();
  void TakeAnalogStatistics(std::vector<ExcessStatisticsItem *>& StatisticsResult);
  void TakeDigitalStatistics(std::vector<ExcessStatisticsItem *>& StatisticsResult);
  void CalcAverageValue(const RecordItem& PrevRecord, const RecordItem& record, long& lTotalSeconds, float& fAverageValue);
  void DeleteStatisticsResult();

// Dialog Data
	//{{AFX_DATA(CExcessStatisticsDlg)
	enum { IDD = IDD_DIALOG_EXCESSSTAT };
	CListCtrl	m_listctrl;
	CString	m_strCoalMineName;
	CString	m_strMonUnitId;
	CString	m_strMonUnitName;
	CString	m_strTime;
	float	m_fLimit;
	int		m_nDurationMinutes;
	int		m_nIgnoringMinutes;
	int		m_nState;
  CComboBox m_cbState;
	//}}AFX_DATA
  RecordAckStruct * m_pRecordAckStruct;
  std::vector<ExcessStatisticsItem *> m_StatisticsResult;

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CExcessStatisticsDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CExcessStatisticsDlg)
	virtual BOOL OnInitDialog();
	virtual void OnOK();
	afx_msg void OnExport();
	virtual void OnCancel();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_EXCESSSTATISTICSDLG_H__AF1CE6CD_F31E_4963_A41A_D0FDD976455D__INCLUDED_)
